package com.example.demo.service;

import com.example.demo.mapper.DemoMessageMapper;
import com.example.demo.model.DemoMessageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DemoMessageService {

    @Autowired
    DemoMessageMapper messageMapper;

    public List<DemoMessageBean> selectMessage(String lastId) {
        DemoMessageBean bean = new DemoMessageBean();
        bean.setId(lastId);
        return messageMapper.selectMessage(bean);
    }

    public DemoMessageBean getMessageDetail(String id) {
        DemoMessageBean bean = new DemoMessageBean();
        bean.setId(id);
        return messageMapper.getMessageDetail(bean);
    }

}
